import { jyInstance } from "./utils/jy";
import { cloudAPIURL, iotAPIURL, orgAPIURL } from "@/configs/jy";

// 获取当前用户信息
export const userUserInfo = () => jyInstance.get(cloudAPIURL + "/api/v1/user/user-info");
// 修改用户信息
export const usereditUseredit = (params: { msgtype: "fName" | "fPassword" | "fDescription" | "fParam" | "fStatus" | "fSpecialStyle"; msginfo: string }) => jyInstance.post(cloudAPIURL + "/api/v1/useredit/useredit", params);
// 授权增值服务
export const userAuth = () => jyInstance.get(orgAPIURL + "/api/v1/user/auth");
// 获取用户的摄像头账户
export const cameraAccount = () => jyInstance.get(orgAPIURL + "/api/v1/camera/account");
// 根据摄像头账户id查找摄像头账户详情
export const getCameraCameraAccount = (params: { ID: string }) => jyInstance.get(orgAPIURL + "/api/v1/camera/camera-account", { params });
// 添加摄像头账户
export const cameraCameraAccount = (params: { acctype: string; acckey: string; accinfo: string }) => jyInstance.post(orgAPIURL + "/api/v1/camera/camera-account", params);
// 删除摄像头账户
export const cameraDelCameraAccount = (params: { fid: string }) => jyInstance.get(orgAPIURL + "/api/v1/camera/del-camera-account", { params });
// 获取用户的摄像头服务
export const camera = () => jyInstance.get(orgAPIURL + "/api/v1/camera");
// 根据摄像头服务id查找摄像头服务详情
export const getCameraCamera = (params: { ID: string }) => jyInstance.get(orgAPIURL + "/api/v1/camera/camera", { params });
// 添加摄像头服务
export const cameraCamera = (params: { cameratype: string; cameraid: string; camerainfo: string }) => jyInstance.post(orgAPIURL + "/api/v1/camera/camera", params);
// 删除摄像头服务
export const cameraDelCamera = (params: { fid: string }) => jyInstance.get(orgAPIURL + "/api/v1/camera/del-camera", { params });
// 编辑摄像头账户、服务
export const cameraEdit = (params: { msgtype: "EditCamera" | "EditAdminCamera" | "EditCameraAccount"; msginfo: string }) => jyInstance.post(orgAPIURL + "/api/v1/camera/edit", params);
// 获取所有用户事件
export const equipHistoryAllUserEventInfosZip = (params: { begintime: string; endtime: string }) => jyInstance.post(cloudAPIURL + "/api/v1/equip-history/all-user-event-infos-zip", params);
// 反馈
export const suggest = (params: { mailtype: string; mailtitle: string; mailinfo: string }) => jyInstance.post(iotAPIURL + "/apiV3/UtilV3/Suggest", params);
// 创建工艺
export const processProcessAdd = (params: { fUNID: string; fName: string; icon: string; category1: string; category2: string; flowIndex: number; flowLabel: string; description: string; info: string; configurationData: string }) =>
    jyInstance.post(cloudAPIURL + "/api/v1/process/process-add", params);
// 删除工艺
export const processDelProcess = (params: { id: number; unid: string }) => jyInstance.get(cloudAPIURL + "/api/v1/process/del-procress", { params });
// 编辑工艺
export const processEquipEditJson = (params: {
    id: number;
    fUserID: string;
    fUNID: string;
    fName: string;
    icon: string;
    category1: string;
    category2: string;
    flowIndex: number;
    flowLabel: string;
    description: string;
    info: string;
    configurationData: string;
}) => jyInstance.post(cloudAPIURL + "/api/v1/process/equip-edit-json", params);
// 查询所有工艺
export const processAll = () => jyInstance.get(cloudAPIURL + "/api/v1/process/all");
// 查询工艺配置
export const processConfiguration = (params: { id: number }) => jyInstance.get(cloudAPIURL + "/api/v1/process/configuration", { params });
